<template>
  <div class="main-box">
    <div class="df jc-e">
      <el-button
        v-permission="username"
        class="btn-primary"
        style="margin-bottom: 10px"
        @click="addBlog">
        发布文章
      </el-button>
      <el-button
        v-permission="username"
        class="btn-primary"
        style="margin-bottom: 10px"
        @click="deleteAll">
        删除全部
      </el-button>
    </div>

    <blog-table ref="blogTbaleRef"></blog-table>
  </div>
</template>

<script setup lang="ts">
  import blogTable from '@/components/blog/blog-table.vue';
  import { useUserStore } from '@/stores/userStore';
  const { username } = useUserStore().getUser();
  const blogTbaleRef = ref();
  const deleteAll = () => {
    blogTbaleRef.value?.deleteAll();
  };
  const addBlog = () => {
    blogTbaleRef.value?.addArticle();
  };
</script>

<style scoped></style>
